package net.kelissa.divizor.util.randomdata;

import net.kelissa.divizor.model.DataModel;
import net.kelissa.divizor.util.Const;
import net.kelissa.divizor.util.MathUtil;


public class CurveDivision extends RandomDataCreator
{

  @Override
  public String getLabel(double x, double y)
  {
    String label = Const.POSITIVE;
    if(y*y < x)
      label = Const.NEGATIVE;
    return label;
  }

  @Override
  public DataModel createRandomData()
  {
    DataModel dm = new DataModel();
    double x = MathUtil.getDefaultRandom()/2;
    double y = MathUtil.getDefaultRandom();
    double[] v = {x,y};
    String label = getLabel(x, y);
    dm.setPosition(v);
    dm.setClazzLabel(label);
    return dm;
  }


}
